color plane: Don't allocate 0-size textures
authorMatthias Clasen <mclasen@redhat.com>
Mon, 20 May 2019 12:49:56 +0000 (12:49 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 26 May 2019 04:01:15 +0000 (00:01 -0400)
This triggers critials, and does us no good.

gtk/gtkcolorplane.c

index 17f658c9aced829bfa7c3d931d5ac177bd96ee72..8cf817eb1af0f68cc83cc137625af41c350aa832 100644 (file)
@@ -129,6 +129,9 @@ create_texture (GtkColorPlane *plane)
   width = gtk_widget_get_width (widget);
   height = gtk_widget_get_height (widget);
 
+  if (width == 0 || height == 0)
+    return;
+
   g_clear_object (&plane->priv->texture);
 
   stride = width * 4;